export default [
  {
    url: '/mock/user/page',
    method: 'post',
    timeout: 1000,
    response: ({ query }) => {
      const result = [];
      const { page = 1, pageSize = 20 } = query;
      for (let i = 0; i < pageSize; i++) {
        result.push({
          userId: '@integer(10,100)',
          username: '@cname()',
          createTime: '@datetime',
          registerCode: '@string("number", 6)',
          loginTime: '@datetime',
          loginIp: '@ip',
          status: '@integer(0, 1)',
          count: '@integer(0, 100)'
        });
      }

      return {
        code: 200,
        message: 'ok',
        data: {
          current: +page,
          size: +pageSize,
          total: 100,
          records: result
        }
      };
    }
  },
  {
    url: '/mock/user/edit',
    method: 'post',
    timeout: 1000,
    response: ({ query }) => {
      const result = [];
      const { page = 1, pageSize = 20 } = query;
      result.push({
        userId: '@integer(10,100)',
        username: '@cname()',
        createTime: '@datetime',
        registerCode: '@string("number", 6)',
        loginTime: '@datetime',
        loginIp: '@ip',
        status: '@integer(0, 1)',
        count: '@integer(0, 100)'
      });
      return {
        code: 200,
        message: 'ok',
        data: {
          current: +page,
          size: +pageSize,
          total: 100,
          records: result
        }
      };
    }
  }
];
